<?php
/*! tncode 1.2 author:weiyingbin email:277612909@qq.com
//@ object webiste: http://www.39gs.com/archive/259.html
//@ https://github.com/binwind8/tncode
*/
require_once('config.php');
require_once('functions.php');
require_once('header,allow.php');

//@todo 移除后面的条件
if(!isset($_GET['id'])){
    createCodeJson();
}else if(isset($_GET['id'])){
    $time = $_GET['t'];
    $expectId = md5(CODE_KEY1.$time.CODE_KEY2);
    if($expectId!=$_GET['id']){
        createCodeJson('error id');
    }else if((time()-$time) > 1800){
        createCodeJson('error time');
    }
}


ini_set('display_errors','On');
error_reporting(7);
require_once dirname(__FILE__).'/TnCode.class.php';

$tn  = new TnCode();
$tn->make();
